#! /bin/bash
set -e
LOGFILE=/var/log/gunicorn/lk.log
LOGDIR=$(dirname $LOGFILE)
NUM_WORKERS=3
# user/group to run as
USER=ost
GROUP=ost
PORT=8003 # Этот порт будет разным у каждого django-проекта
cd /home/ost/lk/lk
source ../bin/activate
test -d $LOGDIR || mkdir -p $LOGDIR
exec ../bin/gunicorn -b 0.0.0.0:8003 lk.wsgi:application -w $NUM_WORKERS \
#  --user=$USER --group=$GROUP --log-level=debug \
#  --log-file=$LOGFILE 2>>$LOGFILE \
#  --bind 127.0.0.1:$PORT
